Skip to content

fix: emit error instead of null for unsupported module method calls#154

Merged
cs01 merged 1 commit intomainfrom
fix/silent-null-import-method
Mar 9, 2026
Merged

fix: emit error instead of null for unsupported module method calls#154
cs01 merged 1 commit intomainfrom
fix/silent-null-import-method

Conversation

@cs01
Copy link
Owner

@cs01 cs01 commented Mar 9, 2026

Summary

  • Replace return "null" with return this.ctx.emitError(...) in method-calls.ts when calling methods on unsupported external modules
  • Previously, someModule.method() on a non-relative import silently returned a null pointer, compiling without error but crashing at runtime
  • Now emits a clear compile-time error: 'module.method()' — module 'source' is not supported by ChadScript

Test plan

  • All 437 tests pass
  • Self-hosting verification passes (Stage 0 + Stage 1)

🤖 Generated with Claude Code

@cs01 cs01 merged commit e87fcb2 into main Mar 9, 2026
12 checks passed
@cs01 cs01 deleted the fix/silent-null-import-method branch March 12, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant